package chapter07

import scala.collection.immutable.Queue
import scala.collection.mutable

/**
  * 队列
  */
object Test19_Queue {
  def main(args: Array[String]): Unit = {
    // 创建可变队列
     val queue1 = new mutable.Queue[String]()
    // 入队
    queue1.enqueue("a", "b", "c")
    println(queue1)

    // 出队
    println(queue1.dequeue())


    // 不可变队列
    val queue2 = Queue("a","b","c")
    val queue3: Queue[String] = queue2.enqueue("d")
    println(queue2)
    println(queue3)
  }

}
